import config from "../../static/js/conf/config";
import {request} from "../../static/js/utils/request";

//获取微信小程序用户的openid
export function getWeChatOpenIdData(data){
    return request(config.baseApi+"/v1/wechat_openid","post",data);
}

//保存用户信息
export function saveWeChatUserData(data){
    return request(config.baseApi+"/v1/wechat_login_save","post",data);
}

//微信小程序解密获取手机号
export function getDewxbizdataData(data){
    return request(config.baseApi+"/v1/dewxbizdata","post",data);
}

//将手机号保存到数据库
export function bindWechatPhoneNumberData(data){
    return request(config.baseApi+"/v1/user/wechat_login_bindcellphone","post",data);
}

//会员token认证
export function safeUserData(data){
    return request(config.baseApi+"/v1/safe_user","post",data);
}

//获取用户信息
export function getUserInfoData(data){
    return request(config.baseApi+"/v1/user/userinfo","post",data);
}

//安全退出
export function outLoginData(data){
    return request(config.baseApi+"/v1/outlogin","post",data);
}

//修改会员信息
export function updateUserData(data){
    return request(config.baseApi+"/v1/user/update","post",data);
}

//手机号是否存在
export function existCellphoneData(data){
    return request(config.baseApi+"/v1/exist_cellphone","post",data);
}

//绑定手机号
export function bindCellhoneData(data){
    return request(config.baseApi+"/v1/user/wechat_bind_mobile","post",data);
}

// 会员头像上传
export function uploadHeadData(data) {
    return request(config.baseApi + "/v1/user/uploadhead", "post", data);
}

// 移动端发送短信验证码
export function sendCodeData(data) {
    return request(config.baseApi + "/v1/vcode/send_code", "post", data);
}